package com.briup.cms.api;

import com.baidu.aip.imageclassify.AipImageClassify;

public class AipImageClient {
	//设置APPID/AK/SK
	public static final String APP_ID = "23181622";
	public static final String API_KEY = "5UvrxaOTgjqP0Ulb60rlTg6c";
	public static final String SECRET_KEY = "LOzTl8p7sXuf3G9dCw7kEG93yIsQtGzY";

	// 2.本类内部创建对象实例
	private static AipImageClassify instance = null;

	/**
	 * 1.构造方法私有化，外部不能new
	 */
	private AipImageClient() {}

	// 3.提供一个公有的静态方法，返回实例对象
	public static AipImageClassify getInstance() {
		if (instance == null) {
			instance =  new AipImageClassify(APP_ID, API_KEY, SECRET_KEY);
//
		// 可选：设置网络连接参数
			instance.setConnectionTimeoutInMillis(2000);
			instance.setSocketTimeoutInMillis(60000);
		}
		return instance;
	}

}
